<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: RubyMotionQuery::Format
  
    &mdash; Documentation by YARD 0.8.7.3
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (F)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../RubyMotionQuery.html" title="RubyMotionQuery (module)">RubyMotionQuery</a></span></span>
     &raquo; 
    <span class="title">Format</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: RubyMotionQuery::Format
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">RubyMotionQuery::Format</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">motion/ruby_motion_query/format.rb</dd>
  
</dl>
<div class="clear"></div>








  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#date-class_method" title="date (class method)">+ (Object) <strong>date</strong>(date, format) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>rmq.format.date(Time.now, 'EEE, MMM d, "yy').</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#date_formatter-class_method" title="date_formatter (class method)">+ (Object) <strong>date_formatter</strong>(format) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#numeric-class_method" title="numeric (class method)">+ (Object) <strong>numeric</strong>(number, format) </a>
    

    
      (also: number)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>rmq.format.number(1232, '#,##0.##').</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#numeric_formatter-class_method" title="numeric_formatter (class method)">+ (Object) <strong>numeric_formatter</strong>(format) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="date-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>date</strong>(date, format) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>rmq.format.date(Time.now, 'EEE, MMM d, "yy')</p>

<p>See &lt;<a
href="http://www.unicode.org/reports/tr35/tr35-19.html#Date_Format_Patterns">www.unicode.org/reports/tr35/tr35-19.html#Date_Format_Patterns</a>&gt;
for more information about date format strings.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/format.rb', line 27</span>

<span class='kw'>def</span> <span class='id identifier rubyid_date'>date</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
  <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>Format</span><span class='period'>.</span><span class='id identifier rubyid_date_formatter'>date_formatter</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_stringFromDate'>stringFromDate</span><span class='lparen'>(</span><span class='id identifier rubyid_date'>date</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="date_formatter-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>date_formatter</strong>(format) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


42
43
44
45
46
47
48
49
50
51
52
53</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/format.rb', line 42</span>

<span class='kw'>def</span> <span class='id identifier rubyid_date_formatter'>date_formatter</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
  <span class='ivar'>@_date_formatters</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>

  <span class='comment'># Caching here is very important for performance
</span>  <span class='ivar'>@_date_formatters</span><span class='lbracket'>[</span><span class='id identifier rubyid_format'>format</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='kw'>begin</span>
    <span class='id identifier rubyid_format_template'>format_template</span> <span class='op'>=</span> <span class='const'>NSDateFormatter</span><span class='period'>.</span><span class='id identifier rubyid_dateFormatFromTemplate'>dateFormatFromTemplate</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='comma'>,</span> <span class='label'>options:</span><span class='int'>0</span><span class='comma'>,</span>
                                                      <span class='label'>locale:</span> <span class='const'>NSLocale</span><span class='period'>.</span><span class='id identifier rubyid_currentLocale'>currentLocale</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_date_formatter'>date_formatter</span> <span class='op'>=</span> <span class='const'>NSDateFormatter</span><span class='period'>.</span><span class='id identifier rubyid_alloc'>alloc</span><span class='period'>.</span><span class='id identifier rubyid_init'>init</span>
    <span class='id identifier rubyid_date_formatter'>date_formatter</span><span class='period'>.</span><span class='id identifier rubyid_setDateFormat'>setDateFormat</span><span class='lparen'>(</span><span class='id identifier rubyid_format_template'>format_template</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_date_formatter'>date_formatter</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="numeric-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>numeric</strong>(number, format) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='number-class_method'>number</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>rmq.format.number(1232, '#,##0.##')</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


18
19
20</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/format.rb', line 18</span>

<span class='kw'>def</span> <span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_number'>number</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
  <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>Format</span><span class='period'>.</span><span class='id identifier rubyid_numeric_formatter'>numeric_formatter</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_stringFromNumber'>stringFromNumber</span><span class='lparen'>(</span><span class='id identifier rubyid_number'>number</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="numeric_formatter-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>numeric_formatter</strong>(format) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33
34
35
36
37
38
39
40</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/format.rb', line 31</span>

<span class='kw'>def</span> <span class='id identifier rubyid_numeric_formatter'>numeric_formatter</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
  <span class='ivar'>@_numeric_formatter</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>

  <span class='comment'># Caching here is very important for performance
</span>  <span class='ivar'>@_numeric_formatter</span><span class='lbracket'>[</span><span class='id identifier rubyid_format'>format</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='kw'>begin</span>
    <span class='id identifier rubyid_number_formater'>number_formater</span> <span class='op'>=</span> <span class='const'>NSNumberFormatter</span><span class='period'>.</span><span class='id identifier rubyid_alloc'>alloc</span><span class='period'>.</span><span class='id identifier rubyid_init'>init</span>
    <span class='id identifier rubyid_number_formater'>number_formater</span><span class='period'>.</span><span class='id identifier rubyid_setPositiveFormat'>setPositiveFormat</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_number_formater'>number_formater</span> 
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sun Dec  8 20:15:51 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.3 (ruby-1.9.3).
</div>

  </body>
</html>